package cn.smvc.task.common.service;

import javax.servlet.ServletContext;

import org.springframework.web.context.support.WebApplicationContextUtils;

/**
 * TaskJob
 * @author Ryan
 *
 */
public abstract class TaskJob {
	
	public TaskJob(ServletContext servletContext) {
		super();
		WebApplicationContextUtils.getWebApplicationContext(servletContext)
			.getAutowireCapableBeanFactory().autowireBean(this);
	}

	/**
	 * 主要执行方法
	 */
	public abstract void execute() throws Exception;
	
}
